def fun():
    print('新建用户：N')
    print('登陆用户：E')
    print('退出程序：Q')
    dirt1 = {'警察':'110'}
    while 1:
        instr = str(input('请输入指令:'))
        if instr == 'N':
            name = str(input('请输入用户名'))
            while 1:
                if dirt1.get(name):
                    name = str(input('用户名已被使用，请输入用户名'))
                else:
                    secret = str(input('请输入密码'))
                    dirt1[name] = secret
                    print('注册成功')
                    break
        elif instr == 'E':
            name = str(input('请输入用户名'))
            while 1:
                if dirt1.get(name):
                    secret = str(input('请输入密码'))
                    if dirt1.get(name) == secret:
                        print('登录成功')
                        print('qingx')
                        break
                    else :
                        print('密码错误')
        elif instr == 'Q':
            print('已退出')
            break
fun()
                
        
